package com.quectel.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * 推送类型
 *
 * @author: caolu
 * @email: louis.cao@quectel.com
 * @date: 2022-05-10 14:55:00
 */
public class PushConstants {

    /**
     * 推送类型
     */
    @AllArgsConstructor
    public enum PushType {
        /**
         * 短信
         */
        SMS((byte) 1),

        /**
         * 公众号
         */
        WECHAT_OFFICIAL((byte) 2),

        /**
         * APP推送
         */
        APP((byte) 3);

        @Getter
        @Setter
        private Byte type;

        public static PushType getByType(Byte type) {
            for (PushType typeEnum : PushType.values()) {
                if (typeEnum.getType().equals(type)) {
                    return typeEnum;
                }
            }
            return null;
        }

    }

}
